import React, { Component } from 'react'

export default class Main extends Component {
    state={
        bar:[
            {
                icon:'jiahao',
                title:'健康自查上报',
                describe:'普查所有市民健康状况,根据情况安排相关服务',
                path:'/healthsubmit'
            },
            {
                icon:'dianpu',
                title:'口罩门店查询',
                describe:'提供口罩购买门店查询，及口罩预约购买服务',
                path:'/storesearch'
            }
        ]
    }
    render() {
        const {bar} = this.state
        return (
            <div className="main">

                {/* 背景图 */}
                <div className="bg">
                    <div>健康宝</div>
                </div>

                 {/* 导航 */}
                <div className="bar">
                    {
                        bar.map(item=>(
                            <div key={item.icon} className="unit" onClick={()=>this.props.history.push(item.path)}>
                                <div className={["iconfont","icon-"+item.icon].join(' ')}></div>
                                <div className="txt">
                                    <p>{item.title}</p>
                                    <span>{item.describe}</span>
                                </div>
                            </div>
                        ))
                    }
                </div>
                    
            </div>
        )
    }
}
